<template>
    <div class="personalized">
        <el-row :gutter="15">
            <el-col :span="3" v-for="(item,index) in personalized" :key="index">
                <personalized-item :item="item"  />
            </el-col>
        </el-row>
    </div>
</template>

<script>
import { personalized } from '../../../../api'
import PersonalizedItem from './personalized-item'

export default {
  components: {
    PersonalizedItem
  },
  data () {
    return {
      personalized: []
    }
  },
  created () {
    this.getPersonalized()
  },
  methods: {
    getPersonalized () {
      try {
        personalized().then(res => {
          this.personalized = res.result || []
          console.log('列表', this.personalized)
        })
      } catch (e) {
        console.log(e)
      }
    }
  }
}
</script>

<style lang="scss" scoped>
    .personalized {
        padding: 20px 40px;
        .title {
            font-size: 18px;
            letter-spacing: 5px;
        }
        .class-list {
            display: flex;
            padding: 15px 0;
            .class-item:first-child {
                margin-left: 0;
            }
            .class-item {
                flex: 1;
                flex-shrink: 0;
                background-color: white;
                margin-left: 5px;
                text-align: center;
                font-size: 12px;
                color: #555;
                line-height: 30px;
                cursor: pointer;
            }
            .class-item:hover {
                background-color: #eeeeee;

            }
        }
        .personalized-list{
            display: flex;
            flex-wrap: wrap;
        }
    }
</style>
